<?php
/**
 * User: Peter Wang
 * Date: 16/9/20
 * Time: 下午7:08
 */
return [
    "name" => "yangmiao",
    "servers" => ['httpd', 'job'],
    "httpd" => [
        "server" => [
            "host" => "0.0.0.0",
            "port" => "7777",
            "mem_reboot_rate" => 0.8,//可用内存达到多少自动重启
            "auto_reload" => "10:00",//每天10点重启
            "log_file" => STORAGE_PATH . "/tmp/log",
            'static_path' => [
                "^\/static" => ROOT_PATH . '/resource/static',
            ],
            "static_expire_time" => 86400,
            "task_fail_log" => STORAGE_PATH . "/tmp/task_fail_log",
            "task_retry_count" => 2,
            "task_timeout" => 1,
            "serialization" => 1,
            "view" => [
                "path" => APPLICATION_PATH . "/templates/default",
                "compile_path" => STORAGE_PATH . "/compile",
                "page404" => "page404"
            ],
            "gzip" => 4,
            //是否后台运行, 推荐设置0
            'daemonize' => 0,
            //设置为CPU的1-4倍最合理
            'worker_num' => 1,
            "dispatch_mode" => 3,
            //一般设置为CPU核数的1-4倍，在swoole中reactor_num最大不得超过CPU核数*4。
            'reactor_num' => 8,
            "task_worker_num" => 1,//task worker 数量
            "max_request" => 5,
            'heartbeat_check_interval' => 10,
            'heartbeat_idle_time' => 60,
        ],
    ],
    "job" => [
        "server" => [
            "auto_reload" => "10:00",//每天10点重启
            //是否后台运行, 推荐设置0
            'daemonize' => 0,
            //worker数量，推荐设置和cpu核数相等
            'worker_num' => 4,
            "mem_reboot_rate" => 0.8,//可用内存达到多少自动重启
            "serialization" => 1,
            "timer_tick" => 500,//每隔多长执行一次,单位毫秒
        ],
        "perform" => []
    ]
];